<script language="Javascript">
	function send(value){
		document.getElementById('submit').disabled = (document.getElementById('num').value<=0)?true:false;
	}
	function initer(){
		document.getElementById('submit').disabled = (document.getElementById('num').value<=0)?true:false;
		document.getElementById('avert').style.display = "none";
	}
	
</script>
<?php
class Form_ModifierArticleBis extends Zend_Form{
		
	public function init(){
		$this->setMethod('post');
		$this->setName('modifierarticlebis');
		$this->setAttrib('enctype','multipart/form-data');
		$articletable = new Table_Articles();
		$articcle = $articletable->getArticleVip($_SESSION['articlevip']);
		
		$addTitre = new Zend_Form_Element_Text('titre');
		$addTitre	->setLabel("Nouveau titre : ")
						->addFilter('StripTags')
						->addValidator('alnum', false, array('allowWhiteSpace'=>true))
						->addValidator('StringLength', false, array(2,50))
						->setValue($articcle->ARTICLE_TITRE)
						->setRequired(FALSE);
						
						
		$addContenu = new Zend_Form_Element_Textarea('contenu');
		$addContenu ->setLabel('Nouveau contenu : ')
						->addValidator('alnum', false, array('allowWhiteSpace'=>true))
						->addFilter('StringTrim')
						->addFilter('StripTags')
						->addValidator('StringLength', false, array(1,100))
						->setAttrib('cols', '40')
						->setAttrib('rows', '4')
						->setValue($articcle->ARTICLE_RESUME)
						->setAttrib ( 'placeholder', 'Laisser vide si aucune modification n\'est requise' );
						
		$addNumpagedeb = new Zend_Form_Element_Text('pagedeb');
		$addNumpagedeb	->setLabel("Nouvelle page de debut : ")
						->addFilter('StripTags')
						->addValidator('regex',false, '/[0-9]+/')
						->addValidator('StringLength', false, array(1,11))
						->setValue($articcle->ARTICLE_NUMEROPAGEDEBUT)
						->setRequired(FALSE);
		
		$submit = new Zend_Form_Element_Submit('submitbis');
		$submit->setLabel('Modifier');
		
		$this->addElements(array($addTitre,$addContenu,$addNumpagedeb, $submit));
		
		?>
		<script language="Javascript">
			initer();
		</script>
		<?php 	
		
		//On modifie les styles par default
		
		$this->setElementDecorators(array('ViewHelper','Description','Errors',
                   array(array('data'=>'HtmlTag'), array('tag' => 'td')),
                   array('Label', array('tag' => 'td')),
                   array(array('row'=>'HtmlTag'),array('tag'=>'tr'))));
        
		$submit->setDecorators(array(
				'ViewHelper','Description','Errors', array(array('data'=>'HtmlTag'),
				array('tag' => 'td','colspan'=>'2','align'=>'left')),
				array(array('row'=>'HtmlTag'),array('tag'=>'tr'))
       ));
       
		
		$this->setDecorators(array('FormElements', array(array('data'=>'HtmlTag'),array('tag'=>'table')),'Form'));
	}
	
}